package hcn.protocol.brandnew.zhenliao.jianyan;

import lombok.Data;
import javax.xml.bind.annotation.*;
import java.util.List;
import hcn.protocol.brandnew.BaseRequest;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.atag.sysrouter.annotation.DictionaryMapping;

/**
 * 检验申请信息查询 - ODS_03050012
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "MsgBody")
@XmlAccessorType(XmlAccessType.FIELD)
public class LabRequestQueryRequest extends BaseRequest {

    /**
     * 就诊摘要
     */
    @XmlElement(name = "Visit")
    private Visit visit;
    /**
     * 患者基本信息
     */
    @XmlElement(name = "Patient")
    private Patient patient;
    /**
     * 申请请求信息
     */
    @XmlElement(name = "LabRequest")
    private LabRequest labRequest;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Visit {

        /**
         * 就诊流水号
         */
        @XmlElement(name = "VisitId")
        private String visitId;
        /**
         * 就诊机构代码
         */
        @XmlElement(name = "VisitOrganization")
        private String visitOrganization;
        /**
         * 业务系统患者档案ID
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        /**
         * 患者类型代码
         */
        @XmlElement(name = "PatientType")
        @DictionaryMapping("CV09_00_404")
        private String patientType;
        /**
         * 患者类型名称
         */
        @XmlElement(name = "PatientTypeName")
        private String patientTypeName;
        /**
         * 就诊卡类别代码
         */
        @XmlElement(name = "MedicalCardType")
        private String medicalCardType;
        /**
         * 就诊卡号
         */
        @XmlElement(name = "MedicalCardId")
        private String medicalCardId;
        /**
         * 门（急）诊号
         */
        @XmlElement(name = "ClinicId")
        private String clinicId;
        /**
         * 住院号
         */
        @XmlElement(name = "HospizationId")
        private String hospizationId;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Patient {

        /**
         * 业务系统患者档案ID
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        /**
         * 业务系统患者档案类型
         */
        @XmlElement(name = "SourcePatientIdType")
        private String sourcePatientIdType;
        /**
         * 建档机构代码
         */
        @XmlElement(name = "AuthorOrganization")
        private String authorOrganization;
        /**
         * 身份证件号码
         */
        @XmlElement(name = "IdCard")
        private String idCard;
        /**
         * 医保卡号
         */
        @XmlElement(name = "HealthInsuranceCardId")
        private String healthInsuranceCardId;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class LabRequest {

        /**
         * 检验申请单编号
         */
        @XmlElement(name = "RequestId")
        private String requestId;
        /**
         * 申请单起始时间
         */
        @XmlElement(name = "EffectiveTimeLow")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date effectiveTimeLow;
        /**
         * 申请单截至时间
         */
        @XmlElement(name = "EffectiveTimeHigh")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date effectiveTimeHigh;
        /**
         * 申请执行机构
         */
        @XmlElement(name = "ExamExecuteOrg")
        private String examExecuteOrg;
        /**
         * 检验申请单状态
         */
        @XmlElement(name = "RequestStatus")
        private Byte requestStatus;
        /**
         * 申请医师代码
         */
        @XmlElement(name = "RequestDoctor")
        private String requestDoctor;
        /**
         * 计费标志
         */
        @XmlElement(name = "FeeStatus")
        private Boolean feeStatus;
        /**
         * 标本号
         */
        @XmlElement(name = "BarcodeNo")
        private String barcodeNo;
    }

}
